package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import com.szholly.data.general.Field;
import com.szholly.data.general.GlobalDataType;
import com.szholly.data.general.InterceptorTableBase;
import com.szholly.data.general.metadata.IBaseTable;
import com.szholly.utils.spring.SpringBeanFactory;
import org.springframework.stereotype.Component;
/**
 * OperationGroup
 */
@Component("OperationGroup")
public class OperationGroupTable extends InterceptorTableBase implements IBaseTable {

	public final static String TABLE_NAME = "OC_GROUP";
	
	/**
	 * single ref
	 */
	public static OperationGroupTable getSingleRef() {
		return (OperationGroupTable) SpringBeanFactory.getBean("OperationGroup");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "OperationGroup";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = null;
			
			itemField = new Field();
			itemField.setFieldName(OperationGroupRow.FIELD_GroupName);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(5);
			itemField.setFieldAliasName("组名");
			itemField.setAllowNull(true);
			itemField.setMaxLen(50);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationGroupRow.FIELD_Guid);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("GUID");
			itemField.setAllowNull(false);
			itemField.setMaxLen(100);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationGroupRow.FIELD_CreateTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("创建时间");
			itemField.setAllowNull(true);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "OperationGroup";
	}
}